\hypertarget{class_r_t_o_s_1_1task}{\section{R\-T\-O\-S\-:\-:task Class Reference}
\label{class_r_t_o_s_1_1task}\index{R\-T\-O\-S\-::task@{R\-T\-O\-S\-::task}}
}


an independent thread of execution  




{\ttfamily \#include $<$p\-R\-T\-O\-S.\-h$>$}

Inheritance diagram for R\-T\-O\-S\-:\-:task\-:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=12.000000cm]{class_r_t_o_s_1_1task}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{class_r_t_o_s_1_1task_ae50f0e253e66c53e3b28e388133c8fe7}{task} (unsigned int \hyperlink{class_r_t_o_s_1_1task_ac5a30dff650f3b714491509cabad5dff}{priority}=R\-T\-O\-S\-\_\-\-M\-A\-X\-\_\-\-P\-R\-I\-O\-R\-I\-T\-Y, const char $\ast$tname=\char`\"{}\char`\"{}, unsigned int stacksize=R\-T\-O\-S\-\_\-\-D\-E\-F\-A\-U\-L\-T\-\_\-\-S\-T\-A\-C\-K\-\_\-\-S\-I\-Z\-E)
\begin{DoxyCompactList}\small\item\em constructor, specify priority, name and stacksize \end{DoxyCompactList}\item 
\hypertarget{class_r_t_o_s_1_1task_a5035326ddaf51d9219a17ca6c5a23c83}{\hyperlink{class_r_t_o_s_1_1task_a5035326ddaf51d9219a17ca6c5a23c83}{$\sim$task} (void)}\label{class_r_t_o_s_1_1task_a5035326ddaf51d9219a17ca6c5a23c83}

\begin{DoxyCompactList}\small\item\em throws an error, beacuse tasks should never be destroyed \end{DoxyCompactList}\item 
virtual void \hyperlink{class_r_t_o_s_1_1task_a2e0e3c92d9479336535a2ef877103f36}{suspend} (void)
\begin{DoxyCompactList}\small\item\em suspend a task (prevent execution until a resume) \end{DoxyCompactList}\item 
virtual void \hyperlink{class_r_t_o_s_1_1task_a841b14aaab18d883959f034510dd9376}{resume} (void)
\begin{DoxyCompactList}\small\item\em continue a suspended task \end{DoxyCompactList}\item 
void \hyperlink{class_r_t_o_s_1_1task_aa3eec7220a2724d30e2156cc395035f2}{release} (void)
\begin{DoxyCompactList}\small\item\em release the C\-P\-U to the scheduler \end{DoxyCompactList}\item 
void \hyperlink{class_r_t_o_s_1_1task_a9d639b6f1147e0e3dbc603cdd8c52bd4}{sleep} (unsigned int time)
\begin{DoxyCompactList}\small\item\em wait for some time \end{DoxyCompactList}\item 
\hypertarget{class_r_t_o_s_1_1task_ac5a30dff650f3b714491509cabad5dff}{unsigned int \hyperlink{class_r_t_o_s_1_1task_ac5a30dff650f3b714491509cabad5dff}{priority} (void) const }\label{class_r_t_o_s_1_1task_ac5a30dff650f3b714491509cabad5dff}

\begin{DoxyCompactList}\small\item\em report the task priority \end{DoxyCompactList}\item 
\hypertarget{class_r_t_o_s_1_1task_a56e4d07750c49b6620b0407013b177c1}{const char $\ast$ \hyperlink{class_r_t_o_s_1_1task_a56e4d07750c49b6620b0407013b177c1}{name} (void) const }\label{class_r_t_o_s_1_1task_a56e4d07750c49b6620b0407013b177c1}

\begin{DoxyCompactList}\small\item\em report the task name \end{DoxyCompactList}\item 
\hypertarget{class_r_t_o_s_1_1task_ab02fe6432956956957bb2629dc9a3031}{bool \hyperlink{class_r_t_o_s_1_1task_ab02fe6432956956957bb2629dc9a3031}{is\-\_\-suspended} (void) const }\label{class_r_t_o_s_1_1task_ab02fe6432956956957bb2629dc9a3031}

\begin{DoxyCompactList}\small\item\em report whether the task is currently suspended \end{DoxyCompactList}\item 
\hypertarget{class_r_t_o_s_1_1task_a1e0b2566b673b0e4e6efd63a80284d35}{bool \hyperlink{class_r_t_o_s_1_1task_a1e0b2566b673b0e4e6efd63a80284d35}{is\-\_\-blocked} (void) const }\label{class_r_t_o_s_1_1task_a1e0b2566b673b0e4e6efd63a80284d35}

\begin{DoxyCompactList}\small\item\em report whether the task is currently blocked \end{DoxyCompactList}\item 
\hypertarget{class_r_t_o_s_1_1task_a8ec666474a7668f78da3438dfa818a8e}{bool \hyperlink{class_r_t_o_s_1_1task_a8ec666474a7668f78da3438dfa818a8e}{is\-\_\-ready} (void) const }\label{class_r_t_o_s_1_1task_a8ec666474a7668f78da3438dfa818a8e}

\begin{DoxyCompactList}\small\item\em report whether the task is currently ready for execution \end{DoxyCompactList}\item 
\hypertarget{class_r_t_o_s_1_1task_a76913289a89a86fcf40171e28bfcfe98}{void \hyperlink{class_r_t_o_s_1_1task_a76913289a89a86fcf40171e28bfcfe98}{logging\-\_\-set} (bool log)}\label{class_r_t_o_s_1_1task_a76913289a89a86fcf40171e28bfcfe98}

\begin{DoxyCompactList}\small\item\em for debugging\-: switch logging on or off \end{DoxyCompactList}\item 
\hypertarget{class_r_t_o_s_1_1task_ac94209dd2efea030a70d48dabc890f38}{void \hyperlink{class_r_t_o_s_1_1task_ac94209dd2efea030a70d48dabc890f38}{print} (std\-::ostream \&stream, bool header=true) const }\label{class_r_t_o_s_1_1task_ac94209dd2efea030a70d48dabc890f38}

\begin{DoxyCompactList}\small\item\em print task statistics \end{DoxyCompactList}\item 
\hyperlink{class_r_t_o_s_1_1event}{event} \hyperlink{class_r_t_o_s_1_1task_a6fc603d0f1c8a94813586d3dfd123fcc}{wait} (void)
\begin{DoxyCompactList}\small\item\em wait for all waitables created for this task \end{DoxyCompactList}\item 
\hyperlink{class_r_t_o_s_1_1event}{event} \hyperlink{class_r_t_o_s_1_1task_a7b20fada91e6d232f6791ebc9675e3fc}{wait} (const \hyperlink{class_r_t_o_s_1_1waitable}{waitable} \&w)
\begin{DoxyCompactList}\small\item\em wait for a single waitable \end{DoxyCompactList}\item 
\hyperlink{class_r_t_o_s_1_1event}{event} \hyperlink{class_r_t_o_s_1_1task_a09111916c62632df3042f5991ac7ab42}{wait} (const \hyperlink{class_r_t_o_s_1_1event}{event} \&\hyperlink{class_r_t_o_s_1_1task_aebeb5ca826f7137a66474bbee3bf74a1}{set})
\begin{DoxyCompactList}\small\item\em wait for a set of waitables \end{DoxyCompactList}\item 
\hypertarget{class_r_t_o_s_1_1task_aebeb5ca826f7137a66474bbee3bf74a1}{void \hyperlink{class_r_t_o_s_1_1task_aebeb5ca826f7137a66474bbee3bf74a1}{set} (\hyperlink{class_r_t_o_s_1_1flag}{flag} \&w)}\label{class_r_t_o_s_1_1task_aebeb5ca826f7137a66474bbee3bf74a1}

\begin{DoxyCompactList}\small\item\em set a flag \end{DoxyCompactList}\item 
void \hyperlink{class_r_t_o_s_1_1task_a0ea383a40c40d9f69fe8e29fb36fa40d}{ignore\-\_\-activation\-\_\-time} (void)
\begin{DoxyCompactList}\small\item\em ignore this activation for the statistics \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
virtual void \hyperlink{class_r_t_o_s_1_1task_addc6d52f8792ddba1158d7ae5ef0037d}{main} (void)=0
\begin{DoxyCompactList}\small\item\em task body, must be provided by a derived class \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Friends}
\begin{DoxyCompactItemize}
\item 
\hypertarget{class_r_t_o_s_1_1task_a01d2f5a71b8cd797b5f01fb6940ea353}{class {\bfseries periodic\-\_\-task}}\label{class_r_t_o_s_1_1task_a01d2f5a71b8cd797b5f01fb6940ea353}

\item 
\hypertarget{class_r_t_o_s_1_1task_a0ee29d8961a0b67cea2c3fa76da116da}{class {\bfseries waitable\-\_\-set}}\label{class_r_t_o_s_1_1task_a0ee29d8961a0b67cea2c3fa76da116da}

\item 
\hypertarget{class_r_t_o_s_1_1task_a2d8be07618a92a592c4905e969f9927f}{class {\bfseries flag}}\label{class_r_t_o_s_1_1task_a2d8be07618a92a592c4905e969f9927f}

\item 
\hypertarget{class_r_t_o_s_1_1task_aa5b30b5b619f01a5d94b779bf0e58610}{class {\bfseries R\-T\-O\-S}}\label{class_r_t_o_s_1_1task_aa5b30b5b619f01a5d94b779bf0e58610}

\item 
\hypertarget{class_r_t_o_s_1_1task_a972487b0f63ae9fefb7f6642dae2d452}{void {\bfseries task\-\_\-trampoline} (void)}\label{class_r_t_o_s_1_1task_a972487b0f63ae9fefb7f6642dae2d452}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
an independent thread of execution 

\begin{DoxyVerb}  A task is an independent thread of execution, using its own stack. 
  Tasks share the single CPU, so only one task can be running at any time. 
  The RTOS determines which task is running. 
  A task has two bi-value states that determine whether 
  the task is runnable: the suspended/resumed flag and the 
  waiting/non-waiting flag. 
  A task is runnable only when it is both resumed, and non-waiting. 
  When a task is created it is resumed and non-waiting. 
  ll tasks (and the RTOS code) run in the same memory space, 
  without protection from each other. 
  So a 'wild pointer' in one task can destroy data in 
  another task, or even in the RTOS. 

  Each task is created with a fixed priority, which can be any 
  unsigend integer value below RTOS_MAX_PRIORITY (by default 10_000). 
  After creation the priority can not be changed.
  The value 0 indicates the highest task priority, a higher number 
  indicates a lower priority. 
  Each task must have a unqiue priority, it is an error to create 
  a task with same priority as an existing task. 
  You can omit the priority, in which case the RTOS will 
  select an unused priority starting at RTOS_MAX_PRIORITY 
  (in other words, it will choose a low priority for your task).

  Each task has its own stack. 
  You can specify the size of the stack at task creation. 
  If you omit the stack size, RTOS_DEFAULT_STACK_SIZE will be used 
  (default: 2 Kb). 
  This will be enough for most tasks, if you take care not to 
  allocate big things on the stack, and avoid very deep nesting 
  (watch out for recursion!).

  A task is created by instatiating a class that derives from 
  RTOS::task and supplies a main(). 
  This main() should never return. 
  The fragment below shows how you can do this. 
  The task name is used for statistics and debugging. 
  As shown for the name, it might be wise to get the task parameters 
  as arguments to the constructor of your task.

  @code 
\end{DoxyVerb}
 class my\-\_\-task\-\_\-class \-: public \hyperlink{class_r_t_o_s_1_1task}{R\-T\-O\-S\-::task} \{ public\-: my\-\_\-task\-\_\-class( const char $\ast$name )\-: task( name, // name of the task 10, // task priority 4096 // task stack size )\{\} private\-: void \hyperlink{class_r_t_o_s_1_1task_addc6d52f8792ddba1158d7ae5ef0037d}{main( void )}\{ // put the code of your task here \} \}; my\-\_\-task\-\_\-class my\-\_\-task( \char`\"{}my first task\char`\"{} ); my\-\_\-task\-\_\-class my\-\_\-task( \char`\"{}my second task\char`\"{} );  \begin{DoxyVerb}  The example below is a complete program that shows the 
  standard part (initialization, and a main that calls 
  RTOS::run()), a function for writing to an individual LED, 
  a task class that blinks a LED, and two instatiations of 
  this class. 
  Note that the sleep() is call used instead of mkt_wait_ms 
  or mkt_wait_us. Sleep() causes other tasks to run while 
  this taks is waiting, whereas the mkt_wait_* calls would 
  use monopolize the CPU to do a busy wait.

  Subseqent examples will not show the standard 
  initialization (the part up to the comment line).

  @code 
\end{DoxyVerb}
 \#configure board hu\-\_\-arm\-\_\-v4 \#configure clcd\-\_\-lines 2 \#configure memory rom \#configure baudrate 38400

\#include \char`\"{}p\-R\-T\-O\-S.\-h\char`\"{}

int \hyperlink{class_r_t_o_s_1_1task_addc6d52f8792ddba1158d7ae5ef0037d}{main( void )}\{ \hyperlink{class_r_t_o_s_a27731fa3169d3337e826ff0c9994c384}{R\-T\-O\-S\-::run()}; return 0; \}

// end of standard part

void led\-\_\-set( int n, int v )\{ static int leds = 0; if( v )\{ leds $|$= 1 $<$$<$ n; \} else \{ leds \&=$\sim$ 1 $<$$<$ n; \} mkt\-\_\-leds\-\_\-write( leds ); \}

class blinker \-: public \hyperlink{class_r_t_o_s_1_1task}{R\-T\-O\-S\-::task} \{ public\-: blinker( int L\-E\-D, int period )\-: L\-E\-D( L\-E\-D ), period( period )\{\} private\-: int L\-E\-D, period; void \hyperlink{class_r_t_o_s_1_1task_addc6d52f8792ddba1158d7ae5ef0037d}{main( void )}\{ for(;;)\{ led\-\_\-set( L\-E\-D, 1 ); sleep( period / 2 ); led\-\_\-set( L\-E\-D, 0 ); sleep( period / 2 ); \} \} \};

blinker led0( 0, 1000 M\-S ); blinker led1( 1,  300 M\-S );  \begin{DoxyVerb}  A task can be suspended and resumed by the task::suspend()
  and task::resume() calls. 
  The suspend/resume state does not count the number of suspends 
  and resumes: a suspend call on an already suspended task 
  (or a resume on an already resumed task) has no effect. 
  Suspend and resume are intended for use by the application code: 
  the RTOS will never suspend or resume a task. 
  (The RTOS uses the waiting/non-waiting state, which can 
  not be changed directly by the application.)

  The example below shows one task that beeps the speaker at 1 kHz, 
  while the other taks suspends and resumes the first task to make 
  it beep 5 times, after which it suspends itself, which ends all 
  activity. 
  (This will trigger the RTOS deadlock detection, because a normal 
  embedded application should never terminate.)

  @code 
\end{DoxyVerb}
 class beeper \-: public \hyperlink{class_r_t_o_s_1_1task}{R\-T\-O\-S\-::task} \{ public\-: unsigned int speaker; beeper( unsigned int speaker )\-: speaker( speaker )\{\} void \hyperlink{class_r_t_o_s_1_1task_addc6d52f8792ddba1158d7ae5ef0037d}{main( void )}\{ mkt\-\_\-pin\-\_\-configure( speaker, mkt\-\_\-output); for(;;)\{ mkt\-\_\-pin\-\_\-write( speaker, 1  ); sleep( 500 U\-S ); mkt\-\_\-pin\-\_\-write( speaker, 0  ); sleep( 500 U\-S ); \} \} \}; beeper speaker( 10 );

class suspender \-: public \hyperlink{class_r_t_o_s_1_1task}{R\-T\-O\-S\-::task} \{ void \hyperlink{class_r_t_o_s_1_1task_addc6d52f8792ddba1158d7ae5ef0037d}{main( void )}\{ for( int i = 0; i $<$ 5 ; i++ )\{ speaker.\-resume(); sleep( 500 M\-S ); speaker.\-suspend(); sleep( 1 S ); \} \hyperlink{class_r_t_o_s_1_1task_a2e0e3c92d9479336535a2ef877103f36}{suspend()}; \} \}; suspender task2;  

\subsection{Constructor \& Destructor Documentation}
\hypertarget{class_r_t_o_s_1_1task_ae50f0e253e66c53e3b28e388133c8fe7}{\index{R\-T\-O\-S\-::task@{R\-T\-O\-S\-::task}!task@{task}}
\index{task@{task}!RTOS::task@{R\-T\-O\-S\-::task}}
\subsubsection[{task}]{\setlength{\rightskip}{0pt plus 5cm}R\-T\-O\-S\-::task\-::task (
\begin{DoxyParamCaption}
\item[{unsigned int}]{priority = {\ttfamily RTOS\-\_\-MAX\-\_\-PRIORITY}, }
\item[{const char $\ast$}]{tname = {\ttfamily \char`\"{}\char`\"{}}, }
\item[{unsigned int}]{stacksize = {\ttfamily RTOS\-\_\-DEFAULT\-\_\-STACK\-\_\-SIZE}}
\end{DoxyParamCaption}
)}}\label{class_r_t_o_s_1_1task_ae50f0e253e66c53e3b28e388133c8fe7}


constructor, specify priority, name and stacksize 

Priorities are reasonably-\/valued (below R\-T\-O\-S\-\_\-\-D\-E\-F\-A\-U\-L\-T\-\_\-\-R\-I\-O\-R\-I\-T\-Y) unsigned integers. 0 is te highest priority. Priorities must be unqiue. The default causes the constructor to choose a free priority starting at R\-T\-O\-S\-\_\-\-D\-E\-F\-A\-U\-L\-T\-\_\-\-P\-R\-I\-O\-R\-I\-T\-Y (default\-: 10000).

The name is used for debugging and statistics.

A stack of stack\-\_\-size bytes is allocated for the task. The default is 2 k\-B. 

\subsection{Member Function Documentation}
\hypertarget{class_r_t_o_s_1_1task_a0ea383a40c40d9f69fe8e29fb36fa40d}{\index{R\-T\-O\-S\-::task@{R\-T\-O\-S\-::task}!ignore\-\_\-activation\-\_\-time@{ignore\-\_\-activation\-\_\-time}}
\index{ignore\-\_\-activation\-\_\-time@{ignore\-\_\-activation\-\_\-time}!RTOS::task@{R\-T\-O\-S\-::task}}
\subsubsection[{ignore\-\_\-activation\-\_\-time}]{\setlength{\rightskip}{0pt plus 5cm}void R\-T\-O\-S\-::task\-::ignore\-\_\-activation\-\_\-time (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{class_r_t_o_s_1_1task_a0ea383a40c40d9f69fe8e29fb36fa40d}


ignore this activation for the statistics 

Calling this function makes the \hyperlink{class_r_t_o_s}{R\-T\-O\-S} statistics ignore the current task activation as far as statistics is concerned. You can use this to avoid pullution of your task statistics with the timing effects of debug logging. But make sure you don't use it in the 'normal' execution paths, becaue that would make the statitics lie to you. \hypertarget{class_r_t_o_s_1_1task_addc6d52f8792ddba1158d7ae5ef0037d}{\index{R\-T\-O\-S\-::task@{R\-T\-O\-S\-::task}!main@{main}}
\index{main@{main}!RTOS::task@{R\-T\-O\-S\-::task}}
\subsubsection[{main}]{\setlength{\rightskip}{0pt plus 5cm}virtual void R\-T\-O\-S\-::task\-::main (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [protected]}, {\ttfamily [pure virtual]}}}\label{class_r_t_o_s_1_1task_addc6d52f8792ddba1158d7ae5ef0037d}


task body, must be provided by a derived class 

A task is created by inheriting from task and providing a \hyperlink{class_r_t_o_s_1_1task_addc6d52f8792ddba1158d7ae5ef0037d}{main()} function. Initialisation of the task, including creating its waitables, should be done in the constructor. Don't forget to call the constructor of the task class!

The \hyperlink{class_r_t_o_s_1_1task_addc6d52f8792ddba1158d7ae5ef0037d}{main()} is the body of the task. It should never terminate.

Each task has a unique priority (an unsigned integer). A lower value indicates a higher priority. The \hyperlink{class_r_t_o_s}{R\-T\-O\-S} scheduler will always run the task with the higest-\/priority runnable (neither blocked nor suspended) task. A task runs until it changes this 'situation' by using an \hyperlink{class_r_t_o_s}{R\-T\-O\-S} call that changes its own state to not runnable, or the state of a higher priority task to runnable.

Timers are served only when the \hyperlink{class_r_t_o_s}{R\-T\-O\-S} is activated by calling any of its state-\/changing interfaces. Hence the longest run time between such calls determines the granularity (timewise responsiveness) of the application. Within a timeconsuming computation a task can call \hyperlink{class_r_t_o_s_1_1task_aa3eec7220a2724d30e2156cc395035f2}{release()} to have the \hyperlink{class_r_t_o_s}{R\-T\-O\-S} serve the timers. 

Implemented in \hyperlink{class_i_r_simulatie_ae2f018d9aa6faf6559518404b23ba295}{I\-R\-Simulatie}.

\hypertarget{class_r_t_o_s_1_1task_aa3eec7220a2724d30e2156cc395035f2}{\index{R\-T\-O\-S\-::task@{R\-T\-O\-S\-::task}!release@{release}}
\index{release@{release}!RTOS::task@{R\-T\-O\-S\-::task}}
\subsubsection[{release}]{\setlength{\rightskip}{0pt plus 5cm}void R\-T\-O\-S\-::task\-::release (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}}\label{class_r_t_o_s_1_1task_aa3eec7220a2724d30e2156cc395035f2}


release the C\-P\-U to the scheduler 

Sevices timers and releases the C\-P\-U to a higher priority task if one became ready. \hypertarget{class_r_t_o_s_1_1task_a841b14aaab18d883959f034510dd9376}{\index{R\-T\-O\-S\-::task@{R\-T\-O\-S\-::task}!resume@{resume}}
\index{resume@{resume}!RTOS::task@{R\-T\-O\-S\-::task}}
\subsubsection[{resume}]{\setlength{\rightskip}{0pt plus 5cm}void R\-T\-O\-S\-::task\-::resume (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [virtual]}}}\label{class_r_t_o_s_1_1task_a841b14aaab18d883959f034510dd9376}


continue a suspended task 

Has no effect when the task is not suspended.

Can be extended by an application task to suit its needs. \hypertarget{class_r_t_o_s_1_1task_a9d639b6f1147e0e3dbc603cdd8c52bd4}{\index{R\-T\-O\-S\-::task@{R\-T\-O\-S\-::task}!sleep@{sleep}}
\index{sleep@{sleep}!RTOS::task@{R\-T\-O\-S\-::task}}
\subsubsection[{sleep}]{\setlength{\rightskip}{0pt plus 5cm}void R\-T\-O\-S\-::task\-::sleep (
\begin{DoxyParamCaption}
\item[{unsigned int}]{time}
\end{DoxyParamCaption}
)}}\label{class_r_t_o_s_1_1task_a9d639b6f1147e0e3dbc603cdd8c52bd4}


wait for some time 

Sleeps the task (prevents execution) for the indicated time. \hypertarget{class_r_t_o_s_1_1task_a2e0e3c92d9479336535a2ef877103f36}{\index{R\-T\-O\-S\-::task@{R\-T\-O\-S\-::task}!suspend@{suspend}}
\index{suspend@{suspend}!RTOS::task@{R\-T\-O\-S\-::task}}
\subsubsection[{suspend}]{\setlength{\rightskip}{0pt plus 5cm}void R\-T\-O\-S\-::task\-::suspend (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [virtual]}}}\label{class_r_t_o_s_1_1task_a2e0e3c92d9479336535a2ef877103f36}


suspend a task (prevent execution until a resume) 

Suspends the task (prevents execution). Has no effect when the task is already suspended. Can be extended by an application task.

A concrete task can extend this operation to suit its needs. \hypertarget{class_r_t_o_s_1_1task_a6fc603d0f1c8a94813586d3dfd123fcc}{\index{R\-T\-O\-S\-::task@{R\-T\-O\-S\-::task}!wait@{wait}}
\index{wait@{wait}!RTOS::task@{R\-T\-O\-S\-::task}}
\subsubsection[{wait}]{\setlength{\rightskip}{0pt plus 5cm}{\bf event} R\-T\-O\-S\-::task\-::wait (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{class_r_t_o_s_1_1task_a6fc603d0f1c8a94813586d3dfd123fcc}


wait for all waitables created for this task 

Wait (prevent execution) until at least one of the waitables is set. Return and clear that waitable. Three variants for the parameter\-:


\begin{DoxyItemize}
\item The default (no parameter) waits for all waitables defined for the task.
\item One waitable as argument waits for that specific waitable.
\item The addition (operator+) of waitables\-: wait for any one of those waitables.
\end{DoxyItemize}

It is an error to wait for waitables that have not been created for this task. \hypertarget{class_r_t_o_s_1_1task_a7b20fada91e6d232f6791ebc9675e3fc}{\index{R\-T\-O\-S\-::task@{R\-T\-O\-S\-::task}!wait@{wait}}
\index{wait@{wait}!RTOS::task@{R\-T\-O\-S\-::task}}
\subsubsection[{wait}]{\setlength{\rightskip}{0pt plus 5cm}{\bf event} R\-T\-O\-S\-::task\-::wait (
\begin{DoxyParamCaption}
\item[{const {\bf waitable} \&}]{w}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{class_r_t_o_s_1_1task_a7b20fada91e6d232f6791ebc9675e3fc}


wait for a single waitable 

Wait (prevent execution) until at least one of the waitables is set. Return and clear that waitable. Three variants for the parameter\-:


\begin{DoxyItemize}
\item The default (no parameter) waits for all waitables defined for the task.
\item One waitable as argument waits for that specific waitable.
\item The addition (operator+) of waitables\-: wait for any one of those waitables.
\end{DoxyItemize}

It is an error to wait for waitables that have not been created for this task.  \hypertarget{class_r_t_o_s_1_1task_a09111916c62632df3042f5991ac7ab42}{\index{R\-T\-O\-S\-::task@{R\-T\-O\-S\-::task}!wait@{wait}}
\index{wait@{wait}!RTOS::task@{R\-T\-O\-S\-::task}}
\subsubsection[{wait}]{\setlength{\rightskip}{0pt plus 5cm}{\bf event} R\-T\-O\-S\-::task\-::wait (
\begin{DoxyParamCaption}
\item[{const {\bf event} \&}]{set}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{class_r_t_o_s_1_1task_a09111916c62632df3042f5991ac7ab42}


wait for a set of waitables 

Wait (prevent execution) until at least one of the waitables is set. Return and clear that waitable. Three variants for the parameter\-:


\begin{DoxyItemize}
\item The default (no parameter) waits for all waitables defined for the task.
\item One waitable as argument waits for that specific waitable.
\item The addition (operator+) of waitables\-: wait for any one of those waitables.
\end{DoxyItemize}

It is an error to wait for waitables that have not been created for this task.  

The documentation for this class was generated from the following files\-:\begin{DoxyCompactItemize}
\item 
p\-R\-T\-O\-S.\-h\item 
p\-R\-T\-O\-S.\-cpp\end{DoxyCompactItemize}
